//
//  MqSingleton.m
//  Meiqi
//
//  Created by lanou on 16/1/16.
//  Copyright © 2016年 KFC. All rights reserved.
//

#import "MqSingleton.h"

@implementation MqSingleton

+ (instancetype)shareData
{
    static MqSingleton *single = nil;
    
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        single = [[MqSingleton alloc] init];
    });
    return single;
}

- (instancetype)init{
    
    
    self = [super init];
    
    if (self) {
        
        _localService = [[BMKLocationService alloc] init];
        
        _localService.delegate = self;
        [_localService startUserLocationService];

    }
    
    return self;
}

- (void)didUpdateUserHeading:(BMKUserLocation *)userLocation
{
    NSLog(@"heading is %@",userLocation.heading);
}
//处理位置坐标更新
- (void)didUpdateBMKUserLocation:(BMKUserLocation *)userLocation
{
    
    [MqSingleton shareData].localService = _localService;
    [MqSingleton shareData].lat = userLocation.location.coordinate.latitude;
    [MqSingleton shareData].lon = userLocation.location.coordinate.longitude;

}

    @end
   

